<template>
  <div v-if="Object.keys(shopinfo).length !==0" class="shopinfo">
     <div class="logoinfo">
      <img :src='shopinfo.shoplogo'/>
        <div class="name">{{shopinfo.name}}</div>
     </div>
     <div class="alldata">
     <div class="shopdepict">
       <div class="moreshop">
       <div class="count"><span>{{cscell}}</span></div>
       <div class="shoptext"><span >商品宝贝</span></div>
     </div>
       <div class="moreshop">
       <div class="count"><span>{{shopinfo.cgoods}}</span></div>
       <div class="shoptext"><span >全部宝贝</span></div>
     </div>
     </div>
     <div class="appraise"> 
       <div class="appraiseitem" v-for="(item,index) in shopinfo.score" :key="index+item">
         <span >{{item.name}}</span>
         <div class="scoretext"><span class="itemscore" :class='{scoreactive:item.isBetter}'>{{item.score}}</span></div> 
        <div v-if="item.isBetter" class="isbetter" :class="{isactive:item.isBetter}"> <span >高</span></div>
        <div v-else class="isbetter" :class="{isactive:item.isBetter}"> <span >低</span></div>
       </div>
     </div>
     </div>
     
     <div class="weclome">
       <a :href="shopinfo.allGoodsUrl">进店光顾</a>
     </div>
     
  </div>
</template>

<script>
export default {
  name:'childenshopinfo',
  props:{
    shopinfo:{
      type:Object,
      default(){
        return {}
      }
    }
  },
  computed: {
    cscell(){
    const count= this.shopinfo.csells
     if(count>10000){
      return (count/10000).toFixed(1)+'万'
     }
    }
  }
}
</script>

<style scoped>
   .shopinfo{
    margin-top: 25px;
    /* position: relative; */
    /* position: absolute; */
    /* position: relative; */
    padding-bottom: 10px;
      box-shadow: 0px 3px 1px 0px rgba(192, 192, 192,0.4);
   }
   .logoinfo{
     margin-left: 10px;
     display: flex;
     align-items: center;
   }
  .logoinfo img{
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 1px solid rgb(192,192,192);
  }
  .name{
    margin-left: 10px;
    font-size: 16px;
    font-weight: blod;
  }
  .shopdepict{
    display: flex;
    padding: 0 8px;
    border-right: 2px solid rgba(192,192,192,0.4)
  }
  .shopdepict span{
    color: black;
  }
  .moreshop{
    padding: 15px;
    text-align: center;
  }
  .count{
    font-size: 18px;
    font-weight: bold;
  }
  .shoptext{
    margin-top:10px;
  }
  .alldata{
    display: flex;
    margin-top:15px;
  }
  .appraise{
    margin: 5px 0 0  20px;
  }
  .appraiseitem{
    padding-bottom:10px;
    display:flex;
  }
  .itemscore{
    margin: 0 5px;
  }
  .scoreactive{
    color: red;
  }
  .scoretext{
   margin-left: 5px;
    width: 40px;
  }
  .weclome{
    width: 200px;
    height: 50px;
    background-color: rgb(192,192,192);
    text-align: center;
    margin: 25px auto;
    line-height: 50px;
    font-size: 19px;
    border-radius: 25px;
    font-weight: bold;
  
  }
  .weclome a{
     color: white;
  }
  .isbetter{
    background-color: green;
    margin-left: 10px;
  }
  .isbetter span{
    color: white;
  }
  .isactive{
    background-color: red;
  }
</style>